<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" 	prefix="s"%>
<%@ include file="/jsp/common/common_head.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<title>示界港管理平台</title>
<%@ include file="/jsp/common/common_script.jsp"%>
<style type="text/css">
</style>
<script type="text/javascript">
 var g_userId = '<%=session.getAttribute("userId")%>';
</script>
</head>
<body>
<table class="queryTable" >
	<tr>
		<td class="queryTitle" width="68px">合伙人级别</td>
		<td class="queryContent">
			<select id="queryPartnerLevel" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
				<option value="0" selected>[不限]</option>
				<option value="10">普通合伙人</option>
				<option value="20">高级合伙人</option>
			</select>
		</td>
		<td class="queryTitle" width="80px">申请省会</td>
		<td class="queryContent">
			<select id="queryApplyProv" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 120px" ></select>
		</td>
		<td class="queryTitle" width="80px">申请城市</td>
		<td class="queryContent">
			<select id="queryApplyCity" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 120px" ></select>
		</td>
		<td class="queryTitle" width="80px">申请地区</td>
		<td class="queryContent">
			<select id="queryApplyDist" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 120px" ></select>
		</td>
	</tr>
	<tr>
		<td class="queryTitle" width="68px">合伙人姓名</td>
		<td class="queryContent" >
			<input class="inputText" type="text" style="width:120px" id="queryPartnerName" />
		</td>
		<td class="queryTitle" width="68px">联系电话</td>
		<td class="queryContent" >
			<input class="inputText" type="text" style="width:120px" id="queryPartnerMobile" />
		</td>
		<td class="queryTitle" width="68px">是否有下线</td>
		<td class="queryContent">
			<select id="queryHasCust" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
				<option value="0" selected>[不限]</option>
				<option value="1">存在下线</option>
				<option value="2">不存在下线</option>
			</select>
		</td>
		<td class="queryBtnTd" colspan="2">
			<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search"  onclick="doQuery()">查询</a>
		</td>
	</tr>
</table>

<!-- 合伙人列表 -->
<table id="partnerGrid"></table>

<!-- 合伙人级别编辑窗口 -->
<div id="levelDlg" class="easyui-window" title="" closed="true" style="width:400px; height:180px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:20px;">
		<form id="levelForm"  method="POST">
			<s:hidden name="updId" id="updId"/>
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="levelTable">
				<tr>	
					<td class="queryTitle" width="100px">合伙人级别</td>
					<td class="queryContent" width="200px">
						<select id="updPartnerLevel" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
							<option value="10" selected>普通</option>
							<option value="20">高级</option>
						</select>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="levelBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doUpdLevel()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelUpdLevel()">取消</a>
    </div>
</div>

<!-- 合伙人管辖区域窗口 -->
<div id="areaDlg" class="easyui-window" title="" closed="true" style="width:900px; height:500px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="areaForm"  method="POST">
			<s:hidden name="areaPartnerId" id="areaPartnerId"/>
			<table border="0" class="queryTable" width="440px" height="auto" style="margin-bottom:0px;" id="areaTable">
				<tr>	
					<td class="queryTitle" width="100px">合伙人ID</td>
					<td class="queryContent" width="100px">
						<span id="showAreaPId" style="color:red;"></span>
					</td>
					<td class="queryTitle" width="100px">合伙人姓名</td>
					<td class="queryContent" width="100px">
						<span id="showAreaPNm" style="color:red;"></span>
					</td>
				</tr>
			</table>
			<table id="areaGrid"></table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="areaBtn">
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="closeArea()">关闭</a>
    </div>
</div>

<!-- 添加合伙人管辖区域窗口 -->
<div id="addAreaDlg" class="easyui-window" title="" closed="true" style="width:500px; height:auto;text-align:center; background: #fff;">
	<div border="false" style="padding-left:20px;">
		<form id="addAreaForm"  method="POST">
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="addAreaTable">
				<tr>
					<td class="queryTitle" width="80px">省会</td>
					<td class="queryContent">
						<select id="addAreaProv" name="addAreaProv" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 180px" ></select>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="80px">城市</td>
					<td class="queryContent">
						<select id="addAreaCity" name="addAreaCity" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 180px" ></select>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="80px">地区</td>
					<td class="queryContent">
						<select id="addAreaDist" name="addAreaDist" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 180px" ></select>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="addAreaBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doAddArea()">添加区域</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelAddArea()">取消</a>
    </div>
</div>

<!-- 合伙人收益窗口 -->
<div id="incomeDlg" class="easyui-window" title="" closed="true" style="width:900px; height:500px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="incomeForm"  method="POST">
			<s:hidden name="incomeUId" id="incomeUId"/>
			<s:hidden name="incomePId" id="incomePId"/>
			<table border="0" class="queryTable" width="440px" height="auto" style="margin-bottom:0px;" id="incomeTable">
				<tr>	
					<td class="queryTitle" width="100px">合伙人ID</td>
					<td class="queryContent" width="100px">
						<span id="showIncomePId" style="color:red;"></span>
					</td>
					<td class="queryTitle" width="100px">合伙人姓名</td>
					<td class="queryContent" width="100px">
						<span id="showIncomePNm" style="color:red;"></span>
					</td>
				</tr>
			</table>
			<table id="incomeGrid"></table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="incomeBtn">
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="closeIncomeDlg()">关闭</a>
    </div>
</div>

<!-- 收益状态编辑窗口 -->
<div id="icStateDlg" class="easyui-window" title="" closed="true" style="width:400px; height:180px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:20px;">
		<form id="levelForm"  method="POST">
			<s:hidden name="updIcId" id="updIcId"/>
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="icStateTable">
				<tr>	
					<td class="queryTitle" width="100px">状态</td>
					<td class="queryContent" width="200px">
						<select id="updIcState" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
							<option value="10" selected>新建</option>
							<option value="20">发放失败</option>
							<option value="30">纠纷中</option>
							<option value="40">发放成功</option>
						</select>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="icStateBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doUpdIcState()">确定</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelUpdIcState()">取消</a>
    </div>
</div>

<!-- 添加月收益窗口 -->
<div id="addIncomeDlg" class="easyui-window" title="" closed="true" style="width:750px; height:auto;text-align:center; background: #fff;">
	<div border="false" style="padding-left:20px;">
		<form id="addIncomeForm"  method="POST">
			<s:hidden id="partId"></s:hidden>
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="addIncomeTable">
				<tr>
					<td class="queryTitle" width="120px">年 份</td>
					<td class="queryContent">
						<select id="addIncomeYear" name="addIncomeYear" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 100px" ></select>
					</td>
					<td class="queryTitle" width="120px">月 份</td>
					<td class="queryContent">
						<select id="addIncomeMonth" name="addIncomeMonth" class="easyui-combobox" panelHeight="200px" editable="false" style="width: 100px" ></select>
					</td>
					<td class="queryContent" width="120px">
						<a href="javascript:void(0)" class="easyui-linkbutton" onclick="goIncomeLst()">月订单明细</a>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="120px"><span style="color:blue">基本月收益</span><br><span style="color:red">(单位:RMB分)</span></td>
					<td class="queryContent">
						<s:textfield id="addIncomeBase" cssClass="inputText easyui-validatebox" data-options="" onkeyup="value=value.replace(/[^\d]/gi,'')" cssStyle="color:blue;width:100px"/>
					</td>
					<td class="queryTitle" width="120px"><span style="color:green">高级合伙人额外月收益</span><br><span style="color:red">(单位:RMB分)</span></td>
					<td class="queryContent">
						<s:textfield id="addIncomeExtra" cssClass="inputText easyui-validatebox" data-options="" onkeyup="value=value.replace(/[^\d]/gi,'')" cssStyle="color:green;width:100px"/>
					</td>
					<td class="queryContent" width="120px">
						<a href="javascript:void(0)" class="easyui-linkbutton" onclick="doCalIncome()">计算月收益</a>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="120px"><span style="color:orange">月销售奖励</span><br><span style="color:red">(单位:RMB分)</span></td>
					<td class="queryContent">
						<s:textfield id="addIncomeBonus" cssClass="inputText easyui-validatebox" data-options="" onkeyup="value=value.replace(/[^\d]/gi,'')" cssStyle="color:orange;width:100px"/>
					</td>
					<td class="queryTitle" width="120px"><span style="color:orange">限制条件</span><br><span style="color:red">(地区最少合伙人数)</span></td>
					<td class="queryContent">
						<select id="addIncomeBonusLim" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px" >
						</select>
					</td>
					<td class="queryContent" width="120px">
						<a href="javascript:void(0)" class="easyui-linkbutton" onclick="chkRank()">查看月排名</a>
					</td>
				</tr>
				<tr>	
					<td class="queryTitle" width="120px">备注说明</td>
					<td class="queryContent" colspan="4">
						<textarea id="addIncomeDesc" name="addIncomeDesc" rows="5" cols="55" class="inputText easyui-validatebox" style="width:100%;resize:none;" data-options="required:true,validType:['maxLength[180]']"></textarea>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="addIncomeBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doAddIncome()">添加月收益</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelAddIncome()">取消</a>
    </div>
</div>

<!-- 合伙人下线窗口 -->
<div id="custDlg" class="easyui-window" title="" closed="true" style="width:900px; height:500px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="custForm"  method="POST">
			<s:hidden name="custPId" id="custPId"/>
			<table border="0" class="queryTable" width="440px" height="auto" style="margin-bottom:0px;" id="custTable">
				<tr>	
					<td class="queryTitle" width="100px">合伙人ID</td>
					<td class="queryContent" width="100px">
						<span id="showCustPId" style="color:red;"></span>
					</td>
					<td class="queryTitle" width="100px">合伙人姓名</td>
					<td class="queryContent" width="100px">
						<span id="showCustPNm" style="color:red;"></span>
					</td>
				</tr>
			</table>
			<table id="custGrid"></table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="custBtn">
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="closeCustDlg()">关闭</a>
    </div>
</div>

<div id="ratio" class="easyui-window" closed="true" style="width:580px; height:450px;text-align:center; background: #fff;">
	<table id="ratioGrid"></table>
</div>

<div id="rank" class="easyui-window" closed="true" style="width:1000px; height:450px;text-align:center; background: #fff;">
	<table id='rankGrid'></table>
</div>
<script type="text/javascript" src="${ctx}/js/tg/partnerInfo.js"></script>
<script type="text/javascript" src="${ctx}/js/encrypt/encrypted-min.js"></script>
</body>
</html>
